<?php
if (!isset($loginAction)) {
    $loginAction = get::url(array('ssl' => true));
}
echo $form->open(array('action' => $loginAction, 'id' => 'loginform'));
if (isset($_POST['errors']['login'])) {
    echo $form->getErrorMessageContainer('email', $_POST['errors']['login']);
}
echo $html->div($form->input(array('name' => 'login_email', 'label' => 'Email', 'id' => 'loginemail',
                                      'addBreak' => false)));
echo $html->div($form->input(array('name' => 'login_pass', 'label' => 'Pass', 'type' => 'password',
                                      'id' => 'loginpass', 'addBreak' => false)));

$forgotPassLink = $html->link('javascript: forgotpass();', 'Forgot your password?', array('id' => 'forgotpassword'));
echo '<div id="forgotpass"></div>';
echo $html->jsInline($html->jsTools(true) . 'dom("forgotpass").innerHTML = "' . addslashes($forgotPassLink) . '";
function forgotpass() {
var loginform = dom("loginform");
var forgotPass = document.createElement("input");
forgotPass.setAttribute("type", "hidden");
forgotPass.setAttribute("name", "action");
forgotPass.setAttribute("value", "forgotPassword");
loginform.appendChild(forgotPass);
loginform.submit();
return false;
}');

echo $form->input(array('type' => 'submit', 'value' => 'Login'));
echo $form->close();